package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.ReservationDto;
import com.zzyl.entity.Reservation;
import com.zzyl.vo.TimeCountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.Objects;

@Mapper
public interface ReservationMapper {
    // 插入预约信息
    int insert(Reservation reservation);

    Page<Reservation> queryByPage(Integer pageNum, Integer pageSize, Integer status,Long userId);

    int deleteReservation(Long id);

    int updateStatus(Reservation reservation);

    int autoUpdateStatus(LocalDateTime time);

    List<Reservation> cancelCount(LocalDateTime localDateTime,Long createBy);

    List<TimeCountVo> countByTime(@Param("startTime") LocalDateTime startTime, @Param("endTime")
    LocalDateTime endTime);


}